package com.rc.saas.tenant.service.elec;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.mapper.elec.RcEvaluateMapper;
import com.rc.saas.tenant.search.elec.RcEvaluateSearch;
import com.rc.saas.tenant.vo.elec.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by sven on 2018-04-17
 */
@Service
public class RcEvaluateServiceImpl implements RcEvaluateService {

    @Autowired
    private RcEvaluateMapper rcEvaluateMapper;

    @Override
    public RcEvaluateMapper getMapper() {
        return rcEvaluateMapper;
    }

    @Override
    public PageInfo<RcEvaluateVo> listByCondition(RcEvaluateSearch rcEvaluateSearch) {
        PageHelper.startPage(rcEvaluateSearch.getOffset(), rcEvaluateSearch.getLimit());
        List<RcEvaluateVo> rcEvaluateList =  rcEvaluateMapper.listByCondition(rcEvaluateSearch);
        return new PageInfo<RcEvaluateVo>(rcEvaluateList);
    }
}